<template>
  <div class="app-container">
    <analyze></analyze>
    <el-tabs v-model="activeName" type="border-card">
      <el-tab-pane label="保险列表" name="0">
        <insurance v-if="activeName == 0" @claims="handleViewClaims"></insurance>
      </el-tab-pane>
      <el-tab-pane label="理赔记录" name="1" >
        <claims v-if="activeName == 1" :insuranceData="insuranceData"></claims>
      </el-tab-pane>
      <el-tab-pane label="保险统计" name="2">
        <statics v-if="activeName == 2"></statics>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>

import insurance from './insurance.vue';
import claims from './claims.vue';
import statics from './statics.vue';
import analyze from './analyze.vue';

export default {
  name: "Staff",
  components: {
    insurance,
    claims,
    statics,
    analyze
  },
  data() {
    return {
      // tab切换值
      activeName: '0',
      // 保单
      insuranceData: {}
    };
  },
  created() {
  },
  methods: {
    // 查看理赔
    handleViewClaims(e){
      this.insuranceData = e;
      this.activeName = '1';
    }
  }
};
</script>
